import java.util.Arrays;
import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int target = scanner.nextInt();
        int[] array={2,7,11,15};
        int array2[][] = searchSum(array,target);
        String ret= Arrays.deepToString(array2);
        System.out.println(ret);
    }
    public static int[][] searchSum(int[] array,int target){
        int ret[][]={{-1},{-1}};
        for (int i = 0; i < array.length-1; i++) {
            for (int j = i+1; j < array.length; j++) {
                if(array[i]+array[j]==target){
                    return ret;
                }
            }
        }
        return ret;
    }
}
